package com.ruibang.glass.material.controller.bcp;

import com.ruibang.glass.material.domain.req.bcp.BcpProductsInReq;
import com.ruibang.glass.material.entity.MaterialContentLot;
import com.ruibang.glass.material.entity.bcp.MaterialBcpProductsIn;
import com.ruibang.glass.material.entity.bcp.MaterialBcpProductsOut;
import com.ruibang.glass.material.service.bcp.MaterialBcpProductsInService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 批次查询 前端控制器
 * </p>
 *
 * @author mameng
 * @since 2024-02-05
 */
@RestController

@RequestMapping("/api/material/bcp/product/in")
@Api(tags={"批次查询"})
public class MaterialBcpProductInController {


    @Autowired
    private MaterialBcpProductsInService materialBcpProductsInService;

    @PostMapping("/list")
    @ApiOperation(value = "半成品理列表查询", response = ResultBody.class)
    public ResultBody getPageList(@RequestBody BcpProductsInReq bcpProductsInReq) {
        return ResultBody.success(materialBcpProductsInService.getPage(bcpProductsInReq));
    }


    @GetMapping("/getOne/{id}")
    @ApiOperation(value = "详情", response = ResultBody.class)
    public ResultBody getMaterialBcpProductsInInfo(@PathVariable("id") String id) {
        MaterialContentLot materialContentLotById = materialBcpProductsInService.getMaterialContentLotById(id);
        return ResultBody.success(materialContentLotById);
    }

    @PostMapping("/getListByIds")
    @ApiOperation(value = "成品半成品id集合查询", response = ResultBody.class)
    public ResultBody getListByIds(@RequestBody BcpProductsInReq bcpProductsInReq) {
        return ResultBody.success(materialBcpProductsInService.getMaterialContentLotList(bcpProductsInReq));
    }







}
